package JavaDowork.pratice4;

// 打印倒立的正三角形，高度由Scanner输入，例如n=3时
/*
 * *******
 *  *****
 *   ***
 *    *
 */
import java.util.Scanner;

public class Extra {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("三角形的高：");
        int n = scanner.nextInt();
        for (int i = 0; i < n; i++) {
            for (int x = 0; x < i; x++) {
                System.out.print(" ");
            }
            for (int y = 0; y < 2 * (n - i) - 1; y++) {
                System.out.print("*");
            }
            System.out.println();
        }
        scanner.close();
    }
}
